<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FitnessMVC.Data.UserProfile>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit Profile</h2>

    <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Change Yourself</legend>
            
            <%= Html.Hidden("ProfileID", Model.ProfileID) %>
            <%= Html.Hidden("UserID", Model.UserID) %>
            <%= Html.Hidden("MemberSince", Model.MemberSince.ToString("MM-dd-yyyy")) %>
            <p>
                <label for="FirstName">First Name:</label>
                <%= Html.TextBox("FirstName", Model.FirstName) %>
                <%= Html.ValidationMessage("FirstName", "*") %>
            </p>
            <p>
                <label for="LastName">Last Name:</label>
                <%= Html.TextBox("LastName", Model.LastName) %>
                <%= Html.ValidationMessage("LastName", "*") %>
            </p>
            <p>
                <label for="BirthDate">Birth Date:</label>
                <%= Html.TextBox("BirthDate", String.Format("{0:MM-dd-yyyy}", Model.BirthDate)) %>
                <%= Html.ValidationMessage("BirthDate", "*") %>
            </p>
            <p>
                <label for="Sex">
                    Sex:</label>
                Male <%= Html.RadioButton("Sex", 'm', Model.Sex == 'm')%> Female <%= Html.RadioButton("Sex", 'f', Model.Sex == 'f' )%>
                <%= Html.ValidationMessage("Sex", "*") %>
            </p>
            <p>
                <label for="Hometown">Hometown:</label>
                <%= Html.TextBox("Hometown", Model.Hometown) %>
                <%= Html.ValidationMessage("Hometown", "*") %>
            </p>
            <p>
                <label for="AboutMe">Tell Us About Yourself:</label>
                <%= Html.TextArea("AboutMe", Model.AboutMe, new { rows = 10, cols = 50 })%>
                <%= Html.ValidationMessage("AboutMe", "*") %>
            </p>            
            <p>
                <label for="IsPublic">Is Your Profile Public?</label>
                <%= Html.CheckBox("IsPublic", Model.IsPublic) %> Yes
                <%= Html.ValidationMessage("IsPublic", "*") %>
            </p>
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

